#!perl

use strict;
use warnings;

use File::Path;

die "ERROR: no library specified." unless @ARGV==1;
my $lib = $ARGV[0];
my $tech="/app/lib/cni32/tech/cni130/santanaTech/Santana.tech";

my $command = "update";
$command = "create" unless -e $lib;

system(qq[cngenlib --$command --view --techfile "$tech" pkg:${lib}_source $lib $lib/]);
